home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / PACKET / TFLINK10 / TFLNKSRC / TFLINK.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-14  |  1.5 KB  |  54 lines

  1. /*
  2.  *-----------------------------------------------------------------------
  3.  *
  4.  * TFLINK - program to make TFPCX TSR running a Baycom modem on a
  5.  * COM port appear as a serial (HOST mode) TNC on a second COM port.
  6.  *
  7.  * tnclink.h - include file for definitions and global variables
  8.  *
  9.  *-----------------------------------------------------------------------
  10.  */
  11.  
  12. /* standard inclusion files */
  13. #include <dos.h>
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include <ctype.h>
  17.  
  18.  
  19. /* make any variables external if not in the main module */
  20. #ifndef MAIN_MODULE
  21.     #define    GLOBAL    extern
  22. #else
  23.     #define    GLOBAL
  24. #endif
  25.  
  26. /* boolean types */
  27. #define bool            int
  28. #define FALSE            0
  29. #define TRUE            (! FALSE)
  30.  
  31. /* shorthand types */
  32. #define u_char            unsigned char
  33. #define byte            unsigned char
  34. #define u_int            unsigned int
  35. #define u_long            unsigned long
  36.  
  37. /* global variables that hold port and TFPCX interrupt information, and
  38.    also command line flags and options */
  39. GLOBAL bool    nflag;
  40. GLOBAL bool    rflag;
  41. GLOBAL bool    uflag;
  42. GLOBAL int    tfpcx_interrupt;
  43. GLOBAL int    sio_port;
  44. GLOBAL int    sio_baud;
  45.  
  46. /* redefinition of Turbo-C setvect and getvect to avoid calls into
  47.    busy DOS.  These redefinitions are important -  calling Turbo-C
  48.    getvect/setvect within interrupts tends to hang the system. */
  49. #define getvect(V)   (    ( (u_long) \
  50.             (u_int)peek( 0, V * 4 + 2 ) << 16 | \
  51.             (u_int)peek( 0, V * 4 ) ) )
  52. #define setvect(V,A) {    poke( 0, V * 4, (u_long)A & 0xFFFF ); \
  53.             poke( 0, V * 4 + 2, (u_long)A >> 16 ); }
  54.